package com.seanchenxi.gwt.wordpress.xmlrpc.service.local.impl;

import com.seanchenxi.gwt.wordpress.xmlrpc.service.MovableTypeServiceAsync;
import com.seanchenxi.gwt.wordpress.xmlrpc.service.impl.MovableTypeServiceAsyncImpl;

/**
 * The Class MovableTypeLocalServiceAsyncWrapper.
 */
abstract class MovableTypeLocalServiceAsyncWrapper extends
		LocalServiceWrapper {

	/** The movable type service. */
	MovableTypeServiceAsync movableTypeService = null;

	/**
	 * Instantiates a new MovableType local service async wrapper.
	 * 
	 * @param url
	 *            the xmlrpc's url
	 * @param wpUserName
	 *            the wordpress's user name
	 * @param wpPassword
	 *            the wordpress's password
	 */
	public MovableTypeLocalServiceAsyncWrapper(String url, String wpUserName,
			String wpPassword) {

		assert (url != null && url.length() > 7);
		assert (wpUserName != null && wpUserName.trim().length() > 0
				&& wpPassword != null && wpPassword.trim().length() > 0);

		movableTypeService = new MovableTypeServiceAsyncImpl(url);

		assert (movableTypeService != null);

		setWpUser(wpUserName, wpPassword);
	}

	/**
	 * Gets the movable type service.
	 *
	 * @return the movable type service
	 */
	public MovableTypeServiceAsync getMovableTypeService() {
		return movableTypeService;
	}
}
